<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

  <div class="layui-form-item">
    <label class="layui-form-label">网站名称</label>
    <div class="layui-input-inline" style="width: 350px;">
      <script type="text/html" template>
        <input type="text" name="title" id="title" value="{{ d.params.title || '' }}" lay-verify="required" placeholder="网站名称" autocomplete="off" class="layui-input layui-disabled"  disabled="">
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">说明</label>
    <div class="layui-input-inline" style="width: 80%;">
      <script type="text/html" template>
        <textarea name="remark" placeholder="" class="layui-textarea">{{ d.params.remark || '' }}</textarea>
      </script>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">绝对URl</label>
    <div class="layui-input-inline" style="width: 80%;">
      <script type="text/html" template>
        <input type="text" name="url" id="url" value="{{ d.params.url || '' }}" lay-verify="required" placeholder="绝对URl" autocomplete="off" class="layui-input layui-disabled"  disabled="">
      </script>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">说明</label>
    <div class="layui-input-inline" style="width: 80%;">
        <div class="layui-upload-drag" id="uploadTemplate" style="height: 100%;width: 88%;">
            <i class="layui-icon"></i>
            <p>点击上传，或将文件拖拽到此处</p>
            <div class="layui-hide" id="uploadTem"></div>
        </div>
      <div class="layui-progress" lay-showPercent="true" lay-filter="demo">
        <div class="layui-progress-bar layui-bg-red" lay-percent=""></div>
      </div>
    </div>
  </div>
  
  <script type="text/html" template>
    <input type="hidden" name="id" value="{{ d.params.id || '' }}">
  </script>

  <script type="text/html" template>
    <input type="hidden" name="lang" value="{{ layui.data('lang').lang }}">
  </script>

  <div class="layui-form-item">
    <label class="layui-form-label"></label>
    <div class="layui-input-inline">
      <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" value="确认" class="layui-btn">
    </div>
  </div>
</div>
<script>
  layui.use(['admin', 'form', 'upload'], function () {
    var $ = layui.$
      , form = layui.form
      , upload = layui.upload
      , element = layui.element;
    element.render();
    //拖拽上传
    upload.render({
      elem: '#uploadTemplate'
      ,url: '/api/template/uploadTem' //此处用的是第三方的 http 请求演示，实际使用时改成您自己的上传接口即可。
      ,exts: "zip"
      ,progress: function(n, elem, res, index){
        var percent = n + '%' //获取进度百分比
        element.progress('demo', percent); //可配合 layui 进度条元素使用
        element.progress('demo-'+ index, n + '%'); //进度条
      }
      ,done: function(res){
        layer.msg(res.data.msg, { icon: 6 });
        
        $("#url").val(res.data.url);
        $("#title").val(res.data.title);
        console.log(res)
      }
    });

    form.on('radio(status)', function (data) {
      // console.log(data.elem); //得到radio原始DOM对象
      console.log(data.value); //被点击的radio的value值
    });

  })
</script>